home *** CD-ROM | disk | FTP | other *** search
- short: Tools to simplify shared libraries
- type: dev/misc
- author: wiedmann@zdv.uni-tuebingen.de
- uploader: wiedmann@zdv.uni-tuebingen.de
-
-
- This is EasyLibs 1.0, a package of tools and sources to create a shared
- library.
-
- Programming shared libraries is often somewhat nasty: You have to create
- the library header which is done in Assembler (until now :-), you
- have to maintain FD files, prototypes, pragmas, autodocs and all that
- kind of stuff. EasyLibs is my try to do this with less work, even more:
- Most parts are created automatically.
-
- EasyLibs consists of the following parts:
-
- - LibHeader.c 1.0, a complete and universal library header which can
- be used for any type of library you want. Never again edit the
- header, just change some preprocessor symbols! LibHeader.c is
- written in C completely.
-
- LibHeader.c, however, can be used by the Dice compiler only. To be
- precise: You need a possibility to put the resident structure into
- the code segment. Dice allows this by declaring the struct as
- "const".
-
- - Xtract 1.1, a small tool which extracts prototypes, FD files and
- Autodocs from source files. (I personally prefer "autodoc" from the
- NDU for the latter purpose, however.)
-
- - fd2pragma 2.2, a program which can read FD files and convert them
- into either pragma files for different compilers (Aztec, SAS, Dice,
- Maxon), LVO files to be read by assemblers or function tables to
- be read by LibHeader.c.
-
- - HelloWorld.library 40.1, a small shared library which shows how to
- use these tools.
-
-
- Some notes on using LibHeader.c. (Some of them hold true for any library
- regardless of using LibHeader.c)
-
- - You might well use global data; either initialized or uninitialized,
- but keep in mind that this is a *shared* library: Your data will be
- shared by different tasks. In general one uses only things like
- library base pointers or similar stuff in global data.
-
- - The startup code of LibHeader.c does *not* zero the BSS segment.
- Unlike usual C programming you can not expect that variables are
- 0 or NULL, respectively, except if you force this by using something
- like
- struct IntuitionBase *IntuitionBase = NULL;
-
- - It is possible to use the small data model. However, you need to
- setup the a4 register when entering the library. Best way to ensure
- this is declaring all library functions which are visible to the
- outside world as SAVEDS. (See HelloWorldLib.c)
-
- - Dice has the peculiarity to precede function names with an '@' instead
- of the usual '_', if they expect arguments in registers. If they don't
- expect arguments, however, Dice will use the '_' too. So always let
- your library functions expect at least one argument, (The library base
- pointer in a6 is a good choice.) even if you don't need it. The linker
- will claim missing symbols otherwise.
-
-
- EasyLibs is in the public domain, use it as you want, but WITHOUT ANY
- WARRANTY. Bugs, suggestions, notes and beer bottles to
-
- Jochen Wiedmann
- Am Eisteich 9
- 72555 Metzingen
- Germany
-
- Phone: 07123 / 14881
- Internet: wiedmann@zdv.uni-tuebingen.de
-